package com.CGFrame.struts.action.categorySet;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.CGFrame.struts.bean.category.CatemodeltimeBean;
import com.CGFrame.struts.bean.log.LogHistoryBean;

public class DelModelCateAction extends Action {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		String modelCateTimeId=request.getParameter("catetimeid");
		String modelId=request.getParameter("modelId");
		int modelCTimeId = Integer.valueOf(modelCateTimeId);
		CatemodeltimeBean cb=new CatemodeltimeBean();
		cb.delCatemodeltime(modelCTimeId);
		
		LogHistoryBean logBean = new LogHistoryBean();
		String regUserId = (String)request.getSession().getAttribute("RegUserID");
		logBean.saveByReguserId(regUserId, LogHistoryBean.DELETE,null, "Catemodeltime", modelCTimeId );
		
		request.setAttribute("modelId", modelId);
		
		return mapping.findForward("detail");
	}
	
}
